// TypeScript file
class locationObj extends eui.Component{

    private image1:eui.Image;
    private image2:eui.Image;
    private tx_name1:eui.Label;
    private tx_name2:eui.Label;
    private tx_xy:eui.Label;
    private mask1:eui.Image;
    private mask2:eui.Image;
    private _data:any;

	public constructor(userData) {//(用户1数据,用户2数据);
		super();
        this._data = userData;
        this.addEventListener(eui.UIEvent.COMPLETE,this.onComplete,this);
		this.skinName = "src/Game/gameRoom/location/locationObjSkin.exml";				
	}
	private onComplete():void{
        if(this._data){
            this.tx_name1.text = StringOmit.getChar(this._data.user1.name,8);
            this.tx_name2.text = StringOmit.getChar(this._data.user2.name,8);
            this.tx_xy.text = this._data.desc;  
            var ico1:loadImage = new loadImage(this._data.user1.headUrl,this.mask1.width); 
            ico1.x = this.mask1.x;
            ico1.y = this.mask1.y; 
            this.addChild(ico1); 
            ico1.mask = this.mask1;

            var ico2:loadImage = new loadImage(this._data.user2.headUrl,this.mask2.width); 
            ico2.x = this.mask2.x;
            ico2.y = this.mask2.y; 
            this.addChild(ico2); 
            ico2.mask = this.mask2;
        }
	}
}